package Lambda表达式;

public class Text {
    public static void main(String[] args) {
        //1.利用匿名内部类形式
        method(new Swim() {
            @Override
            public void swimming() {
                System.out.println("having swimming");
            }
        });

        //2.利用Lambda的表达式改写
        method(()->{
            System.out.println("having swimming");

        });


    }
    public static void method(Swim s){
        s.swimming();
    }
}
interface Swim{
    public abstract void swimming();
}
abstract class ski{
    public abstract void sking();
}
